![]() |
GetCTable |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Obtains a color table stored in a 'clut' resource.
CTabHandle GetCTable ( SInt16 ctID );
The resource ID of a 'clut' resource.
A handle to the color table. If the 'clut' resource with that ID is not found, GetCTable returns NULL.Before you place this handle in the pmTable field of a PixMap structure, first use the DisposeCTable function to dispose of the handle already there.
Before you modify a ColorTable structure, change its ctSeed field to invalidate it. To do this, use the CTabChanged function.
The GetCTable function recognizes a number of standard 'clut' resource IDs. You can obtain the default grayscale color table for a given pixel depth by calling GetCTable, adding 32 (decimal) to the pixel depth, and passing these values in the ctID parameter:
Pass a resource ID of 33. Color table composition: black, white.
Pass a resource ID of 34. Color table composition: black, 33% gray, 66% gray, white.
Pass a resource ID of 35. Color table composition: black, 14 shades of gray, white.
Pass a resource ID of 36. Color table composition: black, 254 shades of gray, white.
For full color, obtain the default color tables by adding 64 to the pixel depth and passing these values in the ctID parameter:
Pass a resource ID of 66. Color table composition: black, 50% gray, highlight color, white.
Pass a resource ID of 68. Color table composition: black, 14 colors including the highlight color, white.
Pass a resource ID of 72. Color table composition: black, 254 colors including the highlight color, white.
The GetCTable function may move or purge memory blocks in the application heap; do not call this function at interrupt time.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)